home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
qbtools1.arc
/
AECOLINS.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-12-10
|
6KB
|
189 lines
rem $linesize:132
rem $title:'Color installation procedure for Application Engineer'
rem $subtitle:'Initialization'
'
' Initialise standard file (APPCOLOR.CTL)
' with color selection parameters. Previous colors should be displayed.
' Show 8 Items up top of screen with foreground/background/highlight
' words (and blocks).
'
rem $include:'aeshared.bas'
sub aecolins static ' Color Installation
redim sutxt$(8%) ' Sub Routine Descriptions
call color.init("APPCOLOR.CTL") ' Get initial params
data "Pull Down Menus"
data "Dialogue Boxes"
data "Error Messages"
data "Select from List"
data "Yes or No"
data "Press Any Key"
data "Help Text"
data ""
x.co%=1% ' Currently selected item
y.co%=1% ' Currently selected item
darr$=chr$(31%) ' Down arrow
rarr$=chr$(16%) ' Right arrow
restore
for j%=1% to 8%
read sutxt$(j%)
next j%
cls
call centre.text("Color Preferences",1%)
call aecolscr
call centre.text("Use "+darr$+","+rarr$+" to select item, space bar to cycle color, RETURN to save",22%)
for j%=1% to 8%
for k%=1% to 3%
if k%=1% then
x%=5%
attr%=(ae.bg%(j%) and 7%) * 16% + ae.fg%(j%)
elseif k%=2% then
attr%=(ae.bg%(j%) and 7%) * 16% + ae.fg%(j%)
x%=30%
else
attr%=(ae.fg%(j%) and 7%) * 16% + ae.hg%(j%)
x%=56%
end if
call xqprint(sutxt$(j%),4%+(j%*2%),x%,attr%,0%)
next k%
next j%
dsp$=string$(4%,219%)
for j%=0% to 15%
attr%=(0% and 7%) * 16% + j%
call xqprint(dsp$,24%,j%*5%+1%,attr%,0%)
next j%
cycle%=0%
while cycle%=0%
locate 2,1
call clreol
if x.co%=1% then
call qprint(darr$,2%,15%)
po%=ae.fg%(y.co%)
elseif x.co%=2% then
call qprint(darr$,2%,41%)
po%=ae.bg%(y.co%)
elseif x.co%=3% then
call qprint(darr$,2%,66%)
po%=ae.hg%(y.co%)
end if
for k%=1% to 3%
if k%=1% then
x%=5%
attr%=(ae.bg%(y.co%) and 7%) * 16% + ae.fg%(y.co%)
elseif k%=2% then
attr%=(ae.bg%(y.co%) and 7%) * 16% + ae.fg%(y.co%)
x%=30%
elseif k%=3% then
attr%=(ae.fg%(y.co%) and 7%) * 16% + ae.hg%(y.co%)
x%=56%
end if
call xqprint(sutxt$(y.co%),4%+(y.co%*2%),x%,attr%,0%)
next k%
for j%=1% to 8%
call qprint(" ",4%+j%*2%,1%)
next j%
call qprint(rarr$,4%+y.co%*2%,1%)
locate 23,1
call clreol
call qprint(darr$,23%,po%*5%+2%)
call get.single(ccode%,ctype%)
if ctype%=1% then ' Normal character
if ccode%=32% then ' Move to next color
if po%<15% then
po%=po%+1%
else
po%=0%
end if
if x.co%=1% then
ae.fg%(y.co%)=po%
end if
if x.co%=2% then
ae.bg%(y.co%)=po%
end if
if x.co%=3% then
ae.hg%(y.co%)=po%
end if
end if
if ccode%=13% then ' End of colins?
cycle%=1%
end if
end if
if ctype%=2% then ' For arrows
if ccode%=75% then ' Left arrow
x.co%=x.co%-1%
end if
if ccode%=77% then ' Right arrow
x.co%=x.co%+1%
end if
if ccode%=72% then ' Up arrow
y.co%=y.co%-1%
end if
if ccode%=80% then ' Down arrow
y.co%=y.co%+1%
end if
end if
if x.co%>3% then
x.co%=1%
end if
if y.co%>8% then
y.co%=1%
end if
if x.co%<1% then
x.co%=3%
end if
if y.co%<1% then
y.co%=8%
end if
wend
open "r",1,"appcolor.ctl,60
field #1,60 as aa$
bb$=""
for j%=1% to 10%
bb$=bb$+chr$(ae.fg%(j%))+chr$(ae.bg%(j%))+chr$(ae.hg%(j%))
next j%
lset aa$=bb$
put #1,1
close 1
end sub
sub aecolscr static
call qprint("┌───────────────────────────────────────────────────────────────────────────┐",3,3)
call qprint("│ Fore Ground Color Back Ground Color High Light Color │",4,3)
call qprint("╞════════════════════════╤═════════════════════════╤════════════════════════╡",5,3)
call qprint("│ │ │ │",6,3)
call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",7,3)
call qprint("│ │ │ │",8,3)
call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",9,3)
call qprint("│ │ │ │",10,3)
call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",11,3)
call qprint("│ │ │ │",12,3)
call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",13,3)
call qprint("│ │ │ │",14,3)
call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",15,3)
call qprint("│ │ │ │",16,3)
call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",17,3)
call qprint("│ │ │ │",18,3)
call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",19,3)
call qprint("│ │ │ │",20,3)
call qprint("└────────────────────────┴─────────────────────────┴────────────────────────┘",21,3)
end sub ' aecolscr